<template>
  <div>
    <el-date-picker v-model="time" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
      @change="changeData" />
  </div>
</template>

<script setup>
import { ref } from 'vue'
const time = ref([])
const emit = defineEmits(["Update:modelValue"])
const props = defineProps({
  modelValue: {
    type: String,
  }
})
const changeData = (val) => {
  emit("Update:modelValue", val.map(item => item.getTime()).join(','))
}
defineExpose({
  time
})
</script>

<style scoped></style>